package information.details;

import javax.swing.JLabel;
import javax.swing.JTextField;

public class ContactDetails extends AbstractDetails {

	private static final long serialVersionUID = 1L;
	
	protected JTextField[] textFields = new JTextField[6];
	
	public ContactDetails(int width) {
		super(width);

		this.setTitle("Kontakt Informasjon");
		
		this.setupLabelArray();
		this.createTextFieldArray();
	}

	public void setNameText(Object data) {
		this.setPrimaryTextAt(0, data);
	}

	public void setAddress(Object data) {
		this.setPrimaryTextAt(1, data);
	}

	public void setZip(Object data) {
		this.setPrimaryTextAt(2, data);
	}

	public void setLocation(Object data) {
		this.setPrimaryTextAt(3, data);
	}

	public void setPhone(Object data) {
		this.setPrimaryTextAt(4, data);
	}

	public void setEmail(Object data) {
		this.setPrimaryTextAt(5, data);
	}

	public void populateDetails(Object[][] data) {
		this.setAllPrimaryTexts(data[0]);
	}

	
	@Override
	protected void createTextFieldArray() {
		this.setupTextFields(new JTextField[6]);
	}

	@Override
	protected void setupLabelArray() {
		JLabel[] labels = {
			new JLabel("Navn: "),
			new JLabel("Adresse: "),
			new JLabel("Postnummer: "),
			new JLabel("Sted: "),
			new JLabel("Telefon: "),
			new JLabel("E-Mail: ")		
		};
		
		this.addLabels(labels);
	}	
}
